using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;

namespace hosted_gmail_client
{
    public partial class Compose : Form
    {
        public Compose()
        {
            InitializeComponent();
        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
           mshtml.IHTMLWindow2 browser = (mshtml.IHTMLWindow2)webBrowser1.Document.Window.DomWindow;
           browser.execScript("window.opener='_self';","javascript");
        }

        private void Compose_Load(object sender, EventArgs e)
        {
            RegistryKey key = Common.GetRegistryKey(false);
            webBrowser1.Navigate("http://mail.google.com/hosted/" + key.GetValue("emailaddress").ToString().Split(Char.Parse("@"))[1] + "/?view=cm&fs=1&tf=1");
        }

       private void webBrowser1_Quit(object sender,EventArgs e) {
          this.Close();
       }
    }
}